package com.wendu.oa.api;

import com.wendu.oa.common.Constants;
import com.wendu.oa.common.Result;
import com.wendu.oa.dto.MyDto;
import feign.Headers;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@FeignClient("leave")//leave 为需要调用的服务 ID
public interface LeaveApi {

    @GetMapping("/apprev/hello")
    public String getHello();

    @GetMapping(value = "/apprev/app",headers = {"Token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJVU0VSSUQiOiJhZG1pbiIsIlVTRVJOQU1FIjoi55So5oi3MSIsImV4cCI6MTYzMzY4Njc0NX0.2CKiu1YnzcT9y8AHE55luTvVG_hyCUkSZXse0B0wyok"})
    public Result getResult();

    @GetMapping( "/apprev/app")
    public Result getResult2(@RequestHeader(Constants.HEADER_TOKEN) String token,
                             @RequestParam("pageNum") Integer pageNum,
                             @RequestParam("pageSize") Integer pageSize);

    @GetMapping( value="/apprev/app")
    public Result getResult3(@RequestHeader(Constants.HEADER_TOKEN) String token,
                             @SpringQueryMap MyDto myDto);


}
